#include <REGX52.H>
#include "INTRINS.h"

void DelayMs(int time)		//@12.000MHz
{
	unsigned char i, j;
while(time){
	i = 12;
	j = 169;
	do
	{
		while (--j);
	} while (--i);
	time--;
}
}
unsigned char led=0x01;
	unsigned char index=0;
void main(){
	P2=~led;
while(1){
	
if(P3_1==0){
	
DelayMs(20);
while(P3_1==0);
DelayMs(20);
	index=++index>=8?0:index;
	P2=~(led<<index);
	
}
}
}		
